#ifndef ORBIT_ELEMS_H
#define ORBIT_ELEMS_H
#include <QString>
#include <vector>
struct tag_trace_task{
	time_t nUTC{0};
	QString sname;
	QString sid;
	std::string strname;
	std::string line1;
	std::string line2;
	double age_days = 0;
	int max_age_days = 30;
	//===res===
	bool valid = false;
	double lla[3]{0,0,0};
	//paint covers
	int minEL = 5;
	std::vector<double> vec_lat;
	std::vector<double> vec_lon;
	std::vector<double> vec_D;
	std::vector<double> vec_Az;
	std::vector<double> vec_El;
	//Observe
	double ob_lla[3] {0,0,0};
	double az {0};
	double el {0};
	double dis {0};
	double speed {0};
};

inline double warp_to_180(const double v)
{
	double res = v;
	if (v>180)
	{
		int n = ((v+180) / 360);
		res -= n*360;
	}
	else if (v<-180)
	{
		int n = ((180-v) / 360);
		res += n*360;
	}
	assert(res>=-180 && res<=180);
	return res;
}

#endif // ORBIT_ELEMS_H
